{{ header }}
<div id="account-return" class="container">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
      <li class="breadcrumb-item"><a href="{{ breadcrumb.href }}"> {{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  {% if error_warning %}
    <div class="alert alert-danger alert-dismissible"><i class="fas fa-exclamation-circle"></i> {{ error_warning }}</div>
  {% endif %}
  <div class="row">{{ column_left }}
    <div id="content" class="col"> {{ content_top }}
      <h1>{{ heading_title }}</h1>
      <p>{{ text_description }}</p>
      <form action="{{ action }}" method="post" enctype="multipart/form-data">
        <fieldset>
          <legend>{{ text_order }}</legend>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label" for="input-firstname">{{ entry_firstname }}</label>
            <div class="col-sm-10">
              <input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname" class="form-control"/>
              {% if error_firstname %}
                <div class="text-danger">{{ error_firstname }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label" for="input-lastname">{{ entry_lastname }}</label>
            <div class="col-sm-10">
              <input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname" class="form-control"/>
              {% if error_lastname %}
                <div class="text-danger">{{ error_lastname }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label" for="input-email">{{ entry_email }}</label>
            <div class="col-sm-10">
              <input type="text" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control"/>
              {% if error_email %}
                <div class="text-danger">{{ error_email }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label" for="input-telephone">{{ entry_telephone }}</label>
            <div class="col-sm-10">
              <input type="text" name="telephone" value="{{ telephone }}" placeholder="{{ entry_telephone }}" id="input-telephone" class="form-control"/>
              {% if error_telephone %}
                <div class="text-danger">{{ error_telephone }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label" for="input-order-id">{{ entry_order_id }}</label>
            <div class="col-sm-10">
              <input type="text" name="order_id" value="{{ order_id }}" placeholder="{{ entry_order_id }}" id="input-order-id" class="form-control"/>
              {% if error_order_id %}
                <div class="text-danger">{{ error_order_id }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row">
            <label class="col-sm-2 col-form-label" for="input-date-ordered">{{ entry_date_ordered }}</label>
            <div class="col-sm-10 col-md-4">
              <div class="input-group date">
                <input type="text" name="date_ordered" value="{{ date_ordered }}" placeholder="{{ entry_date_ordered }}" id="input-date-ordered" class="form-control"/>
                <div class="input-group-append">
                  <span class="input-group-text"><i class="fas fa-calendar"></i></span>
                </div>
              </div>
            </div>
          </div>
        </fieldset>
        <fieldset>
          <legend>{{ text_product }}</legend>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label" for="input-product">{{ entry_product }}</label>
            <div class="col-sm-10">
              <input type="text" name="product" value="{{ product }}" placeholder="{{ entry_product }}" id="input-product" class="form-control"/>
              {% if error_product %}
                <div class="text-danger">{{ error_product }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label" for="input-model">{{ entry_model }}</label>
            <div class="col-sm-10">
              <input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control"/>
              {% if error_model %}
                <div class="text-danger">{{ error_model }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row">
            <label class="col-sm-2 col-form-label" for="input-quantity">{{ entry_quantity }}</label>
            <div class="col-sm-10">
              <input type="text" name="quantity" value="{{ quantity }}" placeholder="{{ entry_quantity }}" id="input-quantity" class="form-control"/>
            </div>
          </div>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label">{{ entry_reason }}</label>
            <div class="col-sm-10"> {% for return_reason in return_reasons %}
                {% if return_reason.return_reason_id == return_reason_id %}
                  <div class="form-check">
                    <label> <input type="radio" name="return_reason_id" value="{{ return_reason.return_reason_id }}" class="form-check-input" checked="checked"/>
                      {{ return_reason.name }}</label>
                  </div>
                {% else %}
                  <div class="form-check">
                    <label><input type="radio" name="return_reason_id" value="{{ return_reason.return_reason_id }}" class="form-check-input"/>
                      {{ return_reason.name }}</label>
                  </div>
                {% endif %}
              {% endfor %}
              {% if error_reason %}
                <div class="text-danger">{{ error_reason }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group row required">
            <label class="col-sm-2 col-form-label">{{ entry_opened }}</label>
            <div class="col-sm-10">
              <div class="form-check form-check-inline">
                <label>
                  {% if opened %}
                    <input type="radio" name="opened" value="1" class="form-check-input" checked="checked"/>
                  {% else %}
                    <input type="radio" name="opened" value="1" class="form-check-input"/>
                  {% endif %}
                  {{ text_yes }}
                </label>
              </div>
              <div class="form-check form-check-inline">
                <label>
                  {% if not opened %}
                    <input type="radio" name="opened" value="0" class="form-check-input" checked="checked"/>
                  {% else %}
                    <input type="radio" name="opened" value="0" class="form-check-input"/>
                  {% endif %}
                  {{ text_no }}
                </label>
              </div>
            </div>
          </div>
          <div class="form-group row">
            <label class="col-sm-2 col-form-label" for="input-comment">{{ entry_fault_detail }}</label>
            <div class="col-sm-10">
              <textarea name="comment" rows="10" placeholder="{{ entry_fault_detail }}" id="input-comment" class="form-control">{{ comment }}</textarea>
            </div>
          </div>
          {{ captcha }}
        </fieldset>
        {% if text_agree %}
          <div class="d-inline-block pt-2 pd-2 w-100">
            <div class="float-left"><a href="{{ back }}" class="btn btn-danger">{{ button_back }}</a></div>
            <div class="float-right">{{ text_agree }}
              {% if agree %}
                <input type="checkbox" name="agree" value="1" checked="checked"/>
              {% else %}
                <input type="checkbox" name="agree" value="1"/>
              {% endif %}
              <button type="submit" class="btn btn-primary">{{ button_submit }}</button>
            </div>
          </div>
        {% else %}
          <div class="d-inline-block pt-2 pd-2 w-100">
            <div class="float-left"><a href="{{ back }}" class="btn btn-light">{{ button_back }}</a></div>
            <div class="float-right">
              <button type="submit" class="btn btn-primary">{{ button_submit }}</button>
            </div>
          </div>
        {% endif %}
      </form>
      {{ content_bottom }}
    </div>
    {{ column_right }}
  </div>
</div>
<script type="text/javascript"><!--
$('.date').datetimepicker({
	'format': 'YYYY-MM-DD',
	'locale': '{{ datepicker }}',
	'allowInputToggle': true
});
//--></script>
{{ footer }}
